package com.project.poetry.service.entity.po.user;

import com.baomidou.mybatisplus.annotation.*;
import com.project.poetry.common.constant.DictConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 用户信息
 * @author mengxj
 */
@Data
@TableName("sys_user")
public class UserPO {

    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("性别")
    private Integer gender;

    @ApiModelProperty("年龄")
    private Integer age;

    @ApiModelProperty("账号")
    private String loginId;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("是否是管理员  对应字典sys_code 的 type=40")
    private Integer isVip;

    @ApiModelProperty("地址")
    private String address;

    @ApiModelProperty("真实密码")
    private String realPassword;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;

    public boolean isVip(){
        return this.isVip == DictConstant.TRUE;
    }
}
